<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>{$app_name}</title>
<link href="{$TemplateAdminDir}style.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery.min.js"></script>
</head>
<body>
<!--{if $mm_show eq "d_list"} -->
<div>
<h3>部门列表</h3> <hr>
<form action="" method="post" name="elist">
<table border="0" cellspacing="1" cellpadding="0" width="100%" bgcolor="#CCCCCC">
  <tr bgcolor="#33CCCC">
    <th scope="col">编号</th>
    <th scope="col">部门名称</th>
    <th scope="col">部门经理</th>
    <th scope="col">操作</th>
  </tr>
  <!--{foreach from=$departments item=d} -->
  <tr bgcolor="#FFFFFF">
    <td align="center">{$d.id}</td>
    <td align="center">{$d.d_name}</td>
    <td align="center">{if $d.d_manager}{$d.d_manager}{else}<font color="red">未设置</font>{/if}</td>
    <td align="center">
      <a href="department.php?act=mod&did={$d.id}">修改</a> &nbsp;&nbsp;
      <a href="department.php?act=del&did={$d.id}">删除</a></td>
  </tr>
  <!--{foreachelse} -->
  <tr bgcolor="#FFFFFF"><td colspan="8" align="center">没有数据</td></tr>
  <!--{/foreach} -->
</table>

</form>
</div>
<!--{/if} -->
<!--{if $mm_show eq "d_add"} -->
<div>
<h3>添加部门</h3> <hr>
<form action="" method="post" name="dadd">
<table border="0" cellspacing="5" cellpadding="0">
  <tr>
    <td>部门名称：</td>
    <td><input type="text" name="name" /></td>
  </tr>
  <tr>
    <td>部门经理：</td>
    <td><select name="manager">
      <option value="0">--请选择--</option>
      <!--{foreach from=$employee item=e} -->
        <option value="{$e.e_name}">{$e.e_name}</option>
      <!--{/foreach} -->     
      </select>
    </td>
  </tr>  
  
  <tr>
    <td colspan="2" align="center" height="35" valign="bottom">
    <input type="hidden" name="act" value="addu" />
    <input type="submit" value="添加" /> &nbsp; &nbsp;
    <input type="reset" value="重置" />
    </td>
  </tr>
</table>

</form>
</div>
<!--{/if} -->
<!--{if $mm_show eq "d_mod"} -->
<div>
<h3>修改部门</h3> <hr>
<form action="" method="post" name="dmod">
<table border="0" cellspacing="5" cellpadding="0">
  <tr>
    <td>部门名称：</td>
    <td><input type="text" name="name" value="{$d.d_name}" /></td>
  </tr>
  <tr>
    <td>部门经理：</td>
    <td><select name="manager">
      <option value="0">--请选择--</option>
      <!--{foreach from=$employee item=e} -->
        <option value="{$e.e_name}" {if $d.d_manager eq $e.e_name}selected="selected"{/if}>{$e.e_name}</option>
      <!--{/foreach} -->     
      </select>
    </td>
  </tr>  
  
  <tr>
    <td colspan="2" align="center" height="35" valign="bottom">
    <input type="hidden" name="act" value="modu" />
    <input type="hidden" name="did" value="{$did}" />
    <input type="submit" value="修改" />
    </td>
  </tr>
</table>

</form>
</div>
<!--{/if} -->
</body>
</html>